home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 19
/
Mac Magazin and MacEasy Magazine CD - Issue 19.iso
/
Utilities
/
uae-0.4
/
Source Code
/
CPU Sources
/
cpu9.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-02-13
|
43KB
|
1,404 lines
#include "config.h"
#include "amiga.h"
#include "options.h"
#include <stdlib.h>
#include "memory.h"
#include "custom.h"
#include "newcpu.h"
#include "cputbl.h"
void op_9000(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = regs.d[srcreg];
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_9010(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_9018(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ regs.a[srcreg] += (srcreg == 7) ? 2 : 1;
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_9020(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= (srcreg == 7) ? 2 : 1;
{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_9028(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_9030(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}}
void op_9038(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_9039(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_903a(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_903b(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ BYTE src = get_byte(srca);
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}}
void op_903c(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = nextiword();
{ BYTE dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}
void op_9040(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9048(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.a[srcreg];
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9050(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9058(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[srcreg] += 2;
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_9060(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_9068(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9070(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}}
void op_9078(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9079(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_907a(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_907b(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}}
void op_907c(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = nextiword();
{ WORD dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}
void op_9080(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_9088(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.a[srcreg];
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_9090(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_9098(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[srcreg] += 4;
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_90a0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_90a8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_90b0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}}
void op_90b8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_90b9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_90ba(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_90bb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}}}
void op_90bc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = nextilong();
{ LONG dst = regs.d[dstreg];
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
regs.d[dstreg] = (newv);
}}}}}}
void op_90c0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90c8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.a[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90d0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90d8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[srcreg] += 2;
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_90e0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_90e8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90f0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_90f8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90f9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_90fa(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_90fb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ WORD src = get_word(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_90fc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = nextiword();
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_9100(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ BYTE src = regs.d[srcreg];
{ BYTE dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((BYTE)(1)) < 0;
bool flgo = ((BYTE)(newv)) < 0;
bool flgn = ((BYTE)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((BYTE)(newv)) == 0;
regs.n = ((BYTE)(newv)) < 0;
regs.d[dstreg] &= ~0xff; regs.d[dstreg] |= (newv) & 0xff;
}}}}}}}
void op_9108(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= (srcreg == 7) ? 2 : 1;
{ CPTR srca = regs.a[srcreg];
BYTE src = get_byte(srca);
{ regs.a[dstreg] -= (dstreg == 7) ? 2 : 1;
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((BYTE)(1)) < 0;
bool flgo = ((BYTE)(newv)) < 0;
bool flgn = ((BYTE)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((BYTE)(newv)) == 0;
regs.n = ((BYTE)(newv)) < 0;
put_byte(dsta,newv);
}}}}}}}}}
void op_9110(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_9118(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ regs.a[dstreg] += (dstreg == 7) ? 2 : 1;
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}
void op_9120(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ regs.a[dstreg] -= (dstreg == 7) ? 2 : 1;
{ CPTR dsta = regs.a[dstreg];
BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}
void op_9128(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_9130(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}}}
void op_9138(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_9139(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ BYTE src = regs.d[srcreg];
{ CPTR dsta = nextilong();
BYTE dst = get_byte(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((BYTE)(src)) < 0;
bool flgo = ((BYTE)(dst)) < 0;
bool flgn = ((BYTE)(newv)) < 0;
regs.z = ((BYTE)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UBYTE)(src)) > ((UBYTE)(dst));
regs.n = flgn != 0;
put_byte(dsta,newv);
}}}}}}
void op_9140(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ WORD src = regs.d[srcreg];
{ WORD dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((WORD)(1)) < 0;
bool flgo = ((WORD)(newv)) < 0;
bool flgn = ((WORD)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((WORD)(newv)) == 0;
regs.n = ((WORD)(newv)) < 0;
regs.d[dstreg] &= ~0xffff; regs.d[dstreg] |= (newv) & 0xffff;
}}}}}}}
void op_9148(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 2;
{ CPTR srca = regs.a[srcreg];
WORD src = get_word(srca);
{ regs.a[dstreg] -= 2;
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((WORD)(1)) < 0;
bool flgo = ((WORD)(newv)) < 0;
bool flgn = ((WORD)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((WORD)(newv)) == 0;
regs.n = ((WORD)(newv)) < 0;
put_word(dsta,newv);
}}}}}}}}}
void op_9150(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_9158(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ regs.a[dstreg] += 2;
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}
void op_9160(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ regs.a[dstreg] -= 2;
{ CPTR dsta = regs.a[dstreg];
WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}
void op_9168(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_9170(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}}}
void op_9178(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_9179(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ WORD src = regs.d[srcreg];
{ CPTR dsta = nextilong();
WORD dst = get_word(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((WORD)(src)) < 0;
bool flgo = ((WORD)(dst)) < 0;
bool flgn = ((WORD)(newv)) < 0;
regs.z = ((WORD)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((UWORD)(src)) > ((UWORD)(dst));
regs.n = flgn != 0;
put_word(dsta,newv);
}}}}}}
void op_9180(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.d[dstreg];
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((LONG)(1)) < 0;
bool flgo = ((LONG)(newv)) < 0;
bool flgn = ((LONG)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((LONG)(newv)) == 0;
regs.n = ((LONG)(newv)) < 0;
regs.d[dstreg] = (newv);
}}}}}}}
void op_9188(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[dstreg] -= 4;
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ bool xflg = regs.x;
regs.v = regs.c = regs.x = 0;
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
if (xflg)
{{ bool flgs = ((LONG)(1)) < 0;
bool flgo = ((LONG)(newv)) < 0;
bool flgn = ((LONG)((newv-1))) < 0;
if ((!flgs && flgo && !flgn) || (flgs && !flgo && flgn)) regs.v = 1;
if ((flgs && !flgo) || (flgn && (!flgo || flgs))) regs.c = regs.x = 1;
newv--;
}} regs.z = ((LONG)(newv)) == 0;
regs.n = ((LONG)(newv)) < 0;
put_long(dsta,newv);
}}}}}}}}}
void op_9190(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_9198(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ regs.a[dstreg] += 4;
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}
void op_91a0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ regs.a[dstreg] -= 4;
{ CPTR dsta = regs.a[dstreg];
LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}
void op_91a8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg] + (LONG)(WORD)nextiword();
LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_91b0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
ULONG dstreg = (opcode & 7) >> 0;
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = regs.a[dstreg];
UWORD dstdp = nextiword();
dsta += (LONG)(BYTE)(dstdp & 0xFF);
{ ULONG dstdpr = dstdp & 0x8000 ? regs.a[(dstdp & 0x7000) >> 12] : regs.d[(dstdp & 0x7000) >> 12];
if (!(dstdp & 0x800)) dstdpr = (LONG)(WORD)dstdpr;
dsta += dstdpr;
{ LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}}}
void op_91b8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = (LONG)(WORD)nextiword();
LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_91b9(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 3584) >> 9);
{{ LONG src = regs.d[srcreg];
{ CPTR dsta = nextilong();
LONG dst = get_long(dsta);
{ ULONG newv = dst - src;
{ bool flgs = ((LONG)(src)) < 0;
bool flgo = ((LONG)(dst)) < 0;
bool flgn = ((LONG)(newv)) < 0;
regs.z = ((LONG)(newv)) == 0;
regs.v = (flgs != flgo) && (flgn != flgo);
regs.c = regs.x = ((ULONG)(src)) > ((ULONG)(dst));
regs.n = flgn != 0;
put_long(dsta,newv);
}}}}}}
void op_91c0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.d[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91c8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = regs.a[srcreg];
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91d0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91d8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ regs.a[srcreg] += 4;
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_91e0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ regs.a[srcreg] -= 4;
{ CPTR srca = regs.a[srcreg];
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_91e8(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg] + (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91f0(UWORD opcode)
{
ULONG srcreg = (LONG)(BYTE)((opcode & 7) >> 0);
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = regs.a[srcreg];
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_91f8(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = (LONG)(WORD)nextiword();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91f9(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = nextilong();
LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}
void op_91fa(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
srca += (LONG)(WORD)nextiword();
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}
void op_91fb(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ CPTR srca = m68k_getpc();
UWORD srcdp = nextiword();
srca += (LONG)(BYTE)(srcdp & 0xFF);
{ ULONG srcdpr = srcdp & 0x8000 ? regs.a[(srcdp & 0x7000) >> 12] : regs.d[(srcdp & 0x7000) >> 12];
if (!(srcdp & 0x800)) srcdpr = (LONG)(WORD)srcdpr;
srca += srcdpr;
{ LONG src = get_long(srca);
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}}}
void op_91fc(UWORD opcode)
{
ULONG dstreg = (opcode & 3584) >> 9;
{{ LONG src = nextilong();
{ LONG dst = regs.a[dstreg];
{ ULONG newv = dst - src;
regs.a[dstreg] = (newv);
}}}}}